/**
*
*  Elaborado por: Roberto Loaeza Valerio.
*                 geoAPP.
*                 17-abr-2006.
*
**/
package dbClass;

import ewe.data.LiveTreeNode;
import ewe.util.Iterator;



public  class Group extends LiveTreeNode{	
	public Group(){};
	public Group(String nm){name = nm;}
	public String name = "Sin nombre";		
	public String _fields = "nombre";		
	/**
	 * @return  Returns the name.
	 */	
	public String getName()
	{
		return name;
		
	}
	
	public void setName(String newName) {
		name = newName;
	}
	
	public boolean isLeaf() {return false;}
	public static ewe.fx.IImage peopleIcon = new ewe.fx.mImage("ewe/OpenFolder.bmp",ewe.fx.Color.White);
	
	public ewe.fx.IImage getIcon() {return peopleIcon;}		
	public String toString() {return "Grupo: "+getName();}
	
	public void copyChildrenFrom(Group other)
	{
		if (other == null) return;
		for (Iterator it = other.getChildren(); it.hasNext();){
			LiveTreeNode ltn = (LiveTreeNode)it.next();
			LiveTreeNode ltn2 = (LiveTreeNode)ltn.getCopy();
			addChild(ltn2);
			if (ltn2 instanceof Group) ((Group)ltn2).copyChildrenFrom((Group)ltn);
		}
	}
}
